function changeProvince(id,name) {
	if(name=="city"){
		clearOptions("city", 1);
		clearOptions("county", 1);
		if (id == "")
			return;
		$.ajax({
		   url: "/ajaxGetSubRegions.do?pid=" + id + "&t=" + new Date().getTime(),
		   success: function(data) {
		   	 var arr = data.toJSON();
		   	 var city = document.getElementById("city");
		   	 for (var i = 0; i < arr.length; i++) {
		   	   city.appendChild(createOption(arr[i].name, arr[i].id));
		   	 }
		   }
		});
	}
	if(name=="county"){
		clearOptions("county", 1);
		if (id == "")
			return;
		$.ajax({
		   url: "/ajaxGetSubRegions.do?pid=" + id + "&t=" + new Date().getTime(),
		   success: function(data) {
		   	 var arr = data.toJSON();
		   	 var city = document.getElementById("county");
		   	 for (var i = 0; i < arr.length; i++) {
		   	   city.appendChild(createOption(arr[i].name, arr[i].id));
		   	 }
		   }
		});
	}
}

function changeCategory(id, subId) {
	if (subId == "second")
		clearOptions("third");
	clearOptions(subId);
	$.ajax({
	   async:false,
	   url: "/ajaxGetSubCategories.do?pid=" + id + "&t=" + new Date().getTime(),
	   success: function(data) {
	   	 var arr = data.toJSON();
	   	 var select = document.getElementById(subId);
	   	 for (var i = 0; i < arr.length; i++) {
	   	   select.appendChild(createOption(arr[i].name, arr[i].id));
	   	 }
	   }
	});
}